//
//  UIButton + Extension.swift
//  weibo08
//
//  Created by 陈杰明 on 16/3/7.
//  Copyright © 2016年 JM. All rights reserved.
//

import UIKit

extension UIButton {

    convenience init(bkgName: String = "timeline_card_bottom_background", imgName: String, titleName: String, font: CGFloat = 11) {
        self.init()
        //设置背景图片
        self.setBackgroundImage(UIImage(named: bkgName), forState: UIControlState.Normal)
        self.setBackgroundImage(UIImage(named: "\(bkgName)_highlighted"), forState: UIControlState.Highlighted)
        
        //图片
        self.setImage(UIImage(named: imgName), forState: UIControlState.Normal)
        //文字颜色，标题
        self.setTitle(titleName, forState: UIControlState.Normal)
        self.setTitleColor(UIColor.orangeColor(), forState: UIControlState.Normal)
        self.titleLabel?.font = UIFont.systemFontOfSize(font)
    }

}
